package com.gogonow.beetl.chapter2.template;

import java.io.IOException;

import org.beetl.core.Configuration;
import org.beetl.core.GroupTemplate;
import org.beetl.core.Template;
import org.beetl.core.resource.ClasspathResourceLoader;

public class ClasspathTemplate {
	
	public static void main(String[] args) throws IOException {
		//..必须要加文件的分隔符，不然无法找到相应的路径
		ClasspathResourceLoader classLoader = new ClasspathResourceLoader("/template/");
		Configuration cfg = Configuration.defaultConfiguration();
		GroupTemplate gt = new GroupTemplate(classLoader, cfg);
		Template t = gt.getTemplate("beetl.txt");
		System.out.println(t.render());
	}

}
